package com.qmx.launcher.activity.general;

import android.app.Activity;
import android.content.Intent;
import android.graphics.RectF;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.open.androidtvwidget.keyboard.SkbContainer;
import com.open.androidtvwidget.keyboard.SoftKey;
import com.open.androidtvwidget.keyboard.SoftKeyBoardListener;
import com.open.androidtvwidget.utils.OPENLOG;
import com.qmx.launcher.R;

/**
 * @author ChengXiangtong
 * @create 2018/10/30
 * @Describe 终端名称
 */
public class TerminalActivity extends Activity {
    private Button btn_save;
    private EditText ed_terminal_name;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_terminal);
        ed_terminal_name = (EditText) findViewById(R.id.ed_terminal_name);
        btn_save = (Button) findViewById(R.id.btn_save);

        btn_save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent intent = new Intent();
                intent.putExtra("ed_terminal_name", ed_terminal_name.getText().toString());
                //通过intent对象返回结果，必须要调用一个setResult方法，
                //setResult(resultCode, data);第一个参数表示结果返回码，一般只要大于1就可以，但是
                setResult(0, intent);

                finish(); //结束当前的activity的生命周期
            }
        });
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }


}
